package com.lagou.edu.service.impl;

import com.lagou.edu.mapper.UserMapper;
import com.lagou.edu.pojo.User;
import com.lagou.edu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class Userservice implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User findById(Integer id) {
        return userMapper.selectById(id);
    }

    @Override
    public void deleteById(Integer id) {
         userMapper.deleteById(id);
    }

    @Override
    public void update(User user) {
        userMapper.updateById(user);
    }

    @Override
    public void add(User user) {
        userMapper.insert(user);
    }
}
